package com.cx.base.day07_exception.exception;

import org.slf4j.Logger;

import java.util.Scanner;

/**
 * @author shkstart
 * @date 7/25/2019 - 3:42 PM
 */
public class TestException {
    private static final Logger log = org.slf4j.LoggerFactory.getLogger(TestException.class);

    public static void exe1(int i) throws AutoException {
        if (i > 4) {
            throw new AutoException("超时");
        }
    }

    public static void main(String[] args) {
        test();
        Scanner scanner = new Scanner(System.in);
        int i = scanner.nextInt();
        try {
            TestException.exe1(i);
        } catch (AutoException e) {
            e.printStackTrace();
            e.getMessage();
        }
    }

    public static void test() {
        Thread t = new Thread(() -> {
            Error er = new Error("er");
            log.debug("er", er);
            Exception ex = new Exception("ex");
            log.debug("ex", ex);
        });
        t.start();
    }
}
